<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%response.setHeader("Pragma","No-cache");
	response.setHeader("Cache-Control","no-cache");
	response.setDateHeader("Expires", 0);
	response.flushBuffer();%>
<html>
<head>
	<meta charset="utf-8">
	<meta charset="UTF-8">
	<meta http-equiv="Cache-Control" content="max-age=7200" />
	<meta name="format-detection" content="telephone=yes">
	<meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=no">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">
	<style type="text/css">
		#container {
			height: 90vh;
			margin: 0 auto;
		}
	</style>
	<script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
	<script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
	<script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
	<script type="text/javascript" src="${ctxStatic}/ajz/js/jquery.min.js"></script>
</head>
<body>
<div id="container" style="min-width:400px;height:550px"></div>
<script>
    $(document).ready(function() {
		 var msg = 'species';
		 $.ajax({
			 url: "/a/ajz/ajzBaseinfo/findAjzBaseinfoByTableName",
			 type: "POST",
			 data: "msg="+msg,
			 dataType: "json",
			 async: true,
			 success: function (map) {
			     var aqsc_num =  parseInt(map.aqsc_num);
                 var cyfw_num = parseInt(map.cyfw_num);
                 var wzy_num = parseInt(map.wzy_num);
                 var zxxx_num = parseInt(map.zxxx_num);
                 var dmxf_num = parseInt(map.dmxf_num);

                 var aqsc_uncheck_num =  parseInt(map.aqsc_uncheck_num);
                 var cyfw_uncheck_num = parseInt(map.cyfw_uncheck_num);
                 var wzy_uncheck_num = parseInt(map.wzy_uncheck_num);
                 var zxxx_uncheck_num = parseInt(map.zxxx_uncheck_num);
                 var dmxf_uncheck_num = parseInt(map.dmxf_uncheck_num);

                 var aqsc_check_num = aqsc_num - aqsc_uncheck_num;
                 var cyfw_check_num = cyfw_num - cyfw_uncheck_num;
                 var wzy_check_num = wzy_num - wzy_uncheck_num;
                 var zxxx_check_num = zxxx_num - zxxx_uncheck_num;
                 var dmxf_check_num = dmxf_num - dmxf_uncheck_num;

				 getDate(aqsc_uncheck_num,aqsc_check_num,dmxf_uncheck_num,dmxf_check_num,cyfw_uncheck_num,cyfw_check_num,wzy_uncheck_num,wzy_check_num,
                     zxxx_uncheck_num,zxxx_check_num);
			 }
		 });
	});


    function getDate(a,b,c,d,e,f,g,h,i,j) {
		var char;
        chart = Highcharts.chart('container', {
            chart: {
                type: 'column'
            },
            title: {
                text: '安监类别'
            },
            xAxis: {
                categories: ['生产安全', '店面消防', '餐饮服务', '无证园', '小饭桌']
            },
            yAxis: {
                min: 0,
                title: {
                    text: '单位总数'
                },
                stackLabels: {  // 堆叠数据标签
                    enabled: true,
                    style: {
                        fontWeight: 'bold',
                        color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
                    }
                }
            },
            legend: {
                align: 'right',
                x: -30,
                verticalAlign: 'top',
                y: 25,
                floating: true,
                backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
                borderColor: '#CCC',
                borderWidth: 1,
                shadow: false
            },
            tooltip: {
                formatter: function () {
                    return '<b>' + this.x + '</b><br/>' +
                        this.series.name + ': ' + this.y + '<br/>' +
                        '总量: ' + this.point.stackTotal;
                }
            },
            plotOptions: {
                column: {
                    stacking: 'normal',
                    dataLabels: {
                        enabled: true,
                        color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white',
                        style: {
                            // 如果不需要数据标签阴影，可以将 textOutline 设置为 'none'
                            textOutline: '1px 1px black'
                        }
                    }
                }
            },
            series: [{
                name: '未排查',
                data: [a, c, e, g, i]
            }, {
                name: '已排查',
                data: [b, d, f, h, j]
            }]
        });
    }
</script>
</body>
</html>
